package com.ss.android.caijing.stepcounter.permission;

import android.content.pm.PackageManager;

/**
 * Created by sky on 16/7/11.
 */
public abstract class SimplePermissionListenerAdapter implements PermissionCheckHelper.PermissionCallbackListener {

    public SimplePermissionListenerAdapter() {

    }

    @Override
    public void onPermissionCheckCallback(int requestCode, String[] permissions, int[] grantResults) {

        if (permissions == null || permissions.length == 0
                || grantResults == null || grantResults.length == 0) {
            onPermissionDenied();
            return;
        }

        for (int result : grantResults) {
            if (result == PackageManager.PERMISSION_DENIED) {
                onPermissionDenied();
                return;
            }
        }
        onPermissionGranted();
    }

    public void onPermissionGranted() {

    }

    public void onPermissionDenied() {

    }
}
